UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lb4APxHWLd/b5ZwTKktDHVifappvIWZheRk4CBmZDL4=' 
WHERE 
  key_id = '286ff2f4254a076412dbffcd4460382dc30f36bcab659a2b79477984c0ea4a76' 
  AND (
    token = 'lb4APxHWLd/b5ZwTKktDHVifappvIWZheRk4CBmZDL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028