UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6pUjhXvxLea4wIoRFMjp0C62Ww6OKHnCNTIkBqCQbek='
WHERE
key_id = '2ae964b01f15997de51a39b5604c93d62616dc6deed162fd18f3b168ebf6cb4a'
AND (
token = '6pUjhXvxLea4wIoRFMjp0C62Ww6OKHnCNTIkBqCQbek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)