UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EEKSDGDxGAYjDgQMaZXrhOewJ/4ziw8NncAM1Um704M='
WHERE
key_id = 'de6ac6d555003623466a9b2b50fbba197ff763e336d4a12bc33a8a7d009857d5'
AND (
token = 'EEKSDGDxGAYjDgQMaZXrhOewJ/4ziw8NncAM1Um704M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)