UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9CZyPLut96COJhoxkuG/XEQgM7v020/JLVj1cxicRPs='
WHERE
key_id = '514dc8c9838f747c3adf86c4201f2d2048651cf6c9b978a8dee97a5aaf511809'
AND (
token = '9CZyPLut96COJhoxkuG/XEQgM7v020/JLVj1cxicRPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)