UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KKCiar/t2HRgIGwIGNdNzfZn9fSQVfSfS2DcKAxXjdc=' 
WHERE 
  key_id = '63d1c84662478336a8f920c3e73175ab480d315d71ae914ca1b526e81e6c634d' 
  AND (
    token = 'KKCiar/t2HRgIGwIGNdNzfZn9fSQVfSfS2DcKAxXjdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038