UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gYRN6tjl5EiXLPdGyABDZ9Mvy+UijIyZnjNVQQQlenU='
WHERE
key_id = '5f09872c361d6bccdadec0a3d695cbeaaf8d1646373a6c16971955ff7d299478'
AND (
token = 'gYRN6tjl5EiXLPdGyABDZ9Mvy+UijIyZnjNVQQQlenU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)