UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ChBlZTI17wTaamE9d/qW6q5/Om4kp59Gof64RUDZoqg=' 
WHERE 
  key_id = '8eb43b71280c001b0cfc19edefa7f24e29ff8ff7b525e83fa535992070a35caf' 
  AND (
    token = 'ChBlZTI17wTaamE9d/qW6q5/Om4kp59Gof64RUDZoqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030