UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bBk+lxuVkZQu/mq3yHBYiKzrIzgBju+bj2R8BK1bB3Q=' 
WHERE 
  key_id = '3b2dc72c60f0638906d84cb5f2458af0bb51997be83f2c0db22000b694fc647d' 
  AND (
    token = 'bBk+lxuVkZQu/mq3yHBYiKzrIzgBju+bj2R8BK1bB3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028