UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ep9L06ZjBTZYUbWFHPUiJAovErDYEI3VGTTblE7DqqM='
WHERE
key_id = '1d122f67223b2ecc9ecefc5a919f44f69a006415038a80db09cfd9f0e166c341'
AND (
token = 'Ep9L06ZjBTZYUbWFHPUiJAovErDYEI3VGTTblE7DqqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)