UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fJD+JjiOlQ5Va8xs4shQU96ezNqsNGlRxIyh8xb+ado=' 
WHERE 
  key_id = '0925047dfc386821151971d0e1a795c820089a377f00c9e0d27cef32c7ef2c3b' 
  AND (
    token = 'fJD+JjiOlQ5Va8xs4shQU96ezNqsNGlRxIyh8xb+ado=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018