UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8zrV1sSWideeDmVZ2T1txi89Xt13xZ82J9YWYwMAVNQ='
WHERE
key_id = '954e5d05afab552d424d9ff470fa614473e02dde29302f26c0be523904af3adf'
AND (
token = '8zrV1sSWideeDmVZ2T1txi89Xt13xZ82J9YWYwMAVNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)