UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xulsUV8jvUp+QdhKkTS3Mz39ElSmQhReagAJ0RdBN2I='
WHERE
key_id = 'c65b950ae3d4d3cd75986b61b90c32409f7cd0bc328848f2d4096e98897431c0'
AND (
token = 'xulsUV8jvUp+QdhKkTS3Mz39ElSmQhReagAJ0RdBN2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)