UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0DgDzoqWXMQB9zYj/SwOES5eEZgQ+oRAG7DciyZp1uA=' 
WHERE 
  key_id = 'd6688de135b6fdffa4b697a8fd97ca237e1023a72b4d174f9734fdafad57ff9b' 
  AND (
    token = '0DgDzoqWXMQB9zYj/SwOES5eEZgQ+oRAG7DciyZp1uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074