UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BE/pv216gHTCDqmIX2y5ZWsf+aGByM4McHBOQjHg7iU=' 
WHERE 
  key_id = '4993fb80d376ae82ab074e63f4b75b2cca5dba26742a79c793780f9eef2659da' 
  AND (
    token = 'BE/pv216gHTCDqmIX2y5ZWsf+aGByM4McHBOQjHg7iU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038