UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U3uxbG3n/llAFaqusyFUCa4Hy4jwWijTZ8W1dJiVPno=' 
WHERE 
  key_id = '96fad4f6383f0656deb30f25a207ad870ec9b410c9453451a4b6945316d74e54' 
  AND (
    token = 'U3uxbG3n/llAFaqusyFUCa4Hy4jwWijTZ8W1dJiVPno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029