UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K2CaBKPij2BX3B51VEZeTUrw8/o3wZWoe/QX8PAB7NM='
WHERE
key_id = 'f6acb526c709d4ced6332fc1dd9c5d825ccdc69b8408281d73e3b1fb3e0dc7c4'
AND (
token = 'K2CaBKPij2BX3B51VEZeTUrw8/o3wZWoe/QX8PAB7NM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)