UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gg4Me740v1JJ6+6eh7OAYJ3QpKU0IxdM3QXUhWZBcIM=' 
WHERE 
  key_id = '97dd24adb3f2d41d840e7e5ea088a339b9c9ec08f77a35e8660a98ffb306250c' 
  AND (
    token = 'gg4Me740v1JJ6+6eh7OAYJ3QpKU0IxdM3QXUhWZBcIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029