UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ueqznAvuJHaQ+SdGh0/F/hEr7CsLHQFtIy+QbKpyCE='
WHERE
key_id = '4b795647dfecc52d0f2b74eb752352b9908cab17a85bfe1e8c55d1f72ac153e9'
AND (
token = '6ueqznAvuJHaQ+SdGh0/F/hEr7CsLHQFtIy+QbKpyCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)