UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FAlBbUuEsOfnKUkSo7Acg4PlE5b7H00ILmfHfzTBIT4=' 
WHERE 
  key_id = 'abfc8ce3645128fb7e7495440c2eb0ce90bcff980ded5342c8f00ca7668186d8' 
  AND (
    token = 'FAlBbUuEsOfnKUkSo7Acg4PlE5b7H00ILmfHfzTBIT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043