UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2ZivRnAU6jtv34XQSQZQ6yQRgVVrGOaNvxJPVTtQEI='
WHERE
key_id = '744839d1fb5de5c7eec4b318adc46564a3cadaf4ecb6bd0c67ceba6e488d9bca'
AND (
token = 'G2ZivRnAU6jtv34XQSQZQ6yQRgVVrGOaNvxJPVTtQEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)