UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lf2TssNgppP2tarxkQkRWpJRTiD/U9AlqBtMqyyAyEg=' 
WHERE 
  key_id = '760ec71accca3e3f0712f080eff98434cb245611e4fcc5165d99d7ab5d51b846' 
  AND (
    token = 'lf2TssNgppP2tarxkQkRWpJRTiD/U9AlqBtMqyyAyEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034