UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQVYDkgrGT9xbUiK1C8tFsEZmPCCsXHdvkpBPjuuuLU='
WHERE
key_id = '7219f1a1237933a7b035c71445603e0c3a7df14641389453c48fb6466ae83a21'
AND (
token = 'pQVYDkgrGT9xbUiK1C8tFsEZmPCCsXHdvkpBPjuuuLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)