UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFIqhexbc50c7HN3tw3NEBpRl0cLg1NK3aiS+TSNmSI=' 
WHERE 
  key_id = 'eaca52293b81ff4f903563f6ec9a17ba859057a6a4e7b23b9ed665810f404bc6' 
  AND (
    token = 'OFIqhexbc50c7HN3tw3NEBpRl0cLg1NK3aiS+TSNmSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039