UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ysm2YJXfNVKspy4uDLcQ17jkpwdK/+WW3DRRUOCIGE='
WHERE
key_id = '45cbfc6ad6ba45e4790cb3bca31d1aab269b891b55bbaae3702f1903341f3c2c'
AND (
token = '5ysm2YJXfNVKspy4uDLcQ17jkpwdK/+WW3DRRUOCIGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)