UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wyx0dFfGksa+mZ1U7fFPppLhVXHmtyt+J/8Pp3qlLR4=' 
WHERE 
  key_id = 'b68be07b7faf2c27369b1c839638bc7aefa3a50b7afaba1c01e0833a64551bd6' 
  AND (
    token = 'Wyx0dFfGksa+mZ1U7fFPppLhVXHmtyt+J/8Pp3qlLR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017