UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eL85QflJCZrnj7YU/F4T0IoisLe9CR/mjb/tbxMKA4k=' 
WHERE 
  key_id = '757e72bd71df40cb120599e18e891468b59544b16a57aa775711c927e12161ca' 
  AND (
    token = 'eL85QflJCZrnj7YU/F4T0IoisLe9CR/mjb/tbxMKA4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014