UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8MpN477fZFgflk6l9qPhPK/HwXVNedBt7yjzoSAnUh8='
WHERE
key_id = '29fd13ba47531729fdfa2ae56a66c4adbd298a3a1a504d17867f354af6bf935c'
AND (
token = '8MpN477fZFgflk6l9qPhPK/HwXVNedBt7yjzoSAnUh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)