UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GXKufsrswiXIp/PtFQkaNCmiP/l1DP8EdbHrR4fTF+U=' 
WHERE 
  key_id = '964f21d3c60760007d3b3aa20bf54899ac856725b5aeaf465d8a0d468ffe43e0' 
  AND (
    token = 'GXKufsrswiXIp/PtFQkaNCmiP/l1DP8EdbHrR4fTF+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044