UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gsVY5lzQPNcETPEv5YSq7AJKT2FWQlL0j1fdyqrmpg='
WHERE
key_id = '6443c13059c27c48d6542a9a45d35dbd3a5e3aa445fb1c64b17ec86b0fa2f100'
AND (
token = '4gsVY5lzQPNcETPEv5YSq7AJKT2FWQlL0j1fdyqrmpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)