UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UvKkCET/wL8NmwEEWemdkMiWOwdx91oC/079YT4HJPo=' 
WHERE 
  key_id = '6429f1f84eb976e57300f3de9da3f25696122f5a788524d9f2f99847a0592464' 
  AND (
    token = 'UvKkCET/wL8NmwEEWemdkMiWOwdx91oC/079YT4HJPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028