UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HhwyQiTSSJ5J+JXkFLnZLmGPjX47+2ak71K4CAWExAc='
WHERE
key_id = 'e70a9d55796897992341ed715be3a2c97dc14a54cd8dec6e6f76b5a25e294961'
AND (
token = 'HhwyQiTSSJ5J+JXkFLnZLmGPjX47+2ak71K4CAWExAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)