UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFYCq/aioMEShcQIn4atfhm/pPXdzJ3Xg+ANTx7lYtg=' 
WHERE 
  key_id = 'b5d38f200d98373cc00bd3ca6bb1607a3303de20f334a4ae8b8343be2222c6d7' 
  AND (
    token = 'OFYCq/aioMEShcQIn4atfhm/pPXdzJ3Xg+ANTx7lYtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052