UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vNkdWlJsktSWIrVQK49gjiL/NmzT/bZxCpHjk9Zi5JI=' 
WHERE 
  key_id = '6666aa59b71e454dc306a02ea86a64cd1b9fbd4c7fb1a74604e39ca00ba2c697' 
  AND (
    token = 'vNkdWlJsktSWIrVQK49gjiL/NmzT/bZxCpHjk9Zi5JI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031