UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hzDsNuqo2CpBDV4o/eC/xJaCZkeDxMhbe3lNf7AZNwk='
WHERE
key_id = 'cb8c6fc3eafdda1374a328f238d1b5e8806d2353060b28a08b78e2c29c39a6a2'
AND (
token = 'hzDsNuqo2CpBDV4o/eC/xJaCZkeDxMhbe3lNf7AZNwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)