UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/2D1M+UpFZuCQX6gNLl4TTa/dyiRbkayHbXJ9/7BPxQ=' 
WHERE 
  key_id = '59c07fb6e1d7b1ab6d6540a8674cf47d09db01853df328efab20a48337f7f904' 
  AND (
    token = '/2D1M+UpFZuCQX6gNLl4TTa/dyiRbkayHbXJ9/7BPxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00090