UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yxeOZbsz6Nf7pdQ82oJftKvv9uezyG6/AkgZAaOJPUE='
WHERE
key_id = '0333f3828daf51b7295b24d7b9b7669a112c0571ea244784569b0fdfc8221c6e'
AND (
token = 'yxeOZbsz6Nf7pdQ82oJftKvv9uezyG6/AkgZAaOJPUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)