UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bBpS1zjoiNxRYP0dmJkpm2lS3pu8gZj1La4k7HixVkk='
WHERE
key_id = '0325a43e9c4393d9683b8154f546148c51a49c76fbfd2d61db5664bc44ad6c80'
AND (
token = 'bBpS1zjoiNxRYP0dmJkpm2lS3pu8gZj1La4k7HixVkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)