UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oyPLpBvrGo/io0eLwyU9jvu8lPllw+KByf267o+RhjE=' 
WHERE 
  key_id = '46b4a23dab4073ae6f100dc16fd7638dcf902675b731499b96e2eddf65bc97b8' 
  AND (
    token = 'oyPLpBvrGo/io0eLwyU9jvu8lPllw+KByf267o+RhjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019