UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'myUO0g+U26ody26QGyPS+nrB5pXgD6aCoBHG+DXoigY=' 
WHERE 
  key_id = '601bf13a2e24e374df8238d94caf8c64827ae407738fe707ef1cd79b6b4b99ca' 
  AND (
    token = 'myUO0g+U26ody26QGyPS+nrB5pXgD6aCoBHG+DXoigY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033