UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXB9NwaMBNUTfZIVkla14EbKmmh6VgMVJQo/qtRhcEQ=' 
WHERE 
  key_id = '9258a2fc1361273cf8a1804aa49c0c9cb3c3a9e630e144462cb45752dd3fc658' 
  AND (
    token = 'fXB9NwaMBNUTfZIVkla14EbKmmh6VgMVJQo/qtRhcEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038