UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'havVV2CMFX1cDtpO9spVMsDzHhdkSi8YsqG0Rnk7+60=' 
WHERE 
  key_id = '1559d80d7009bffa49ea95a51f9fd4f7005d0e6e3c791b608c2200bc4b054e08' 
  AND (
    token = 'havVV2CMFX1cDtpO9spVMsDzHhdkSi8YsqG0Rnk7+60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029