UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0PHy+pg2aYDOTsQY8n2YhEWMVG2WSuBRYYQ1y3UMibI=' 
WHERE 
  key_id = '0769ca21678448c46f8bb3b34bd5d7008c9c68fcf691d04e7f6d5ea8c306a654' 
  AND (
    token = '0PHy+pg2aYDOTsQY8n2YhEWMVG2WSuBRYYQ1y3UMibI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042