UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oOd5dB7X1J/znY55Z61nsuf4yxz55/X3dwpbICsqYiQ=' 
WHERE 
  key_id = '690789341aa04b18f643bd015da438fe7598211a13d272b38eae3159ab96fd96' 
  AND (
    token = 'oOd5dB7X1J/znY55Z61nsuf4yxz55/X3dwpbICsqYiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023