UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8y0UzrringBwo4y0mvljuTm+avQvLVhYM0XqQBcRvWc='
WHERE
key_id = '42cfe4b428463fd2879824599eb461e85802b0110052ef7b05ab9444d73c6ca6'
AND (
token = '8y0UzrringBwo4y0mvljuTm+avQvLVhYM0XqQBcRvWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)