UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+1/yU38NXmonQEqsrJANglHrXlKwQAAv6G6q625IcJ8=' 
WHERE 
  key_id = 'c97d5ba90618385f7172452c36ea8e8310089d6ee6868494e0b7bb04e5b05462' 
  AND (
    token = '+1/yU38NXmonQEqsrJANglHrXlKwQAAv6G6q625IcJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035