UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kXHbEn5/zvG+g2j3qrm0ZLOPG8E8F1yYCMmIH4Q9RxY='
WHERE
key_id = 'f4b8416e49a3c500f9390cdfb440cfb931ce111391e792e3c18200db42231f15'
AND (
token = 'kXHbEn5/zvG+g2j3qrm0ZLOPG8E8F1yYCMmIH4Q9RxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)