UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PgDh/Pg7cByHftfkzJnDk7pU3qflpsc9mUC7tjEKpe8='
WHERE
key_id = 'd97daf3bda3905aefe5226e99ebb72f39e9ca419d8f72af30e1e8b3fc6f98c55'
AND (
token = 'PgDh/Pg7cByHftfkzJnDk7pU3qflpsc9mUC7tjEKpe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)