UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Cr4uTQQHdyQPWJqLapNYMMZ6FrI8NT6EjJWEPrhXMQ=' 
WHERE 
  key_id = '0826b125cfdeb5e09de3300f689090fb44d7bc4fbc4b0beff06398afc1f77326' 
  AND (
    token = '8Cr4uTQQHdyQPWJqLapNYMMZ6FrI8NT6EjJWEPrhXMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031