UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B8JUfDVNZ7IS3b7/B0P7gCFLvG1DxzYJdSeNqDq5DZs='
WHERE
key_id = '96930cbe6513bc0555b995d8c6c0d3d5c69ebf79a239c69de9b96a81494a98a3'
AND (
token = 'B8JUfDVNZ7IS3b7/B0P7gCFLvG1DxzYJdSeNqDq5DZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)