UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MQdF+vO+Yv2ChVPXfZx+4dM+hmkh74MDDLNwdV1RbDo=' 
WHERE 
  key_id = '7555c19bf0cac6ab2dd2f790a7af11803a4f7e36816622a6012d055dc3edd450' 
  AND (
    token = 'MQdF+vO+Yv2ChVPXfZx+4dM+hmkh74MDDLNwdV1RbDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030