UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wbFwunvMm59swil5xaXUO46bncTlijmDlbg2ukFty/0=' 
WHERE 
  key_id = 'c8ec3fb068b90c26cf64c0cba625f66b2659b0907f401b75d1fdb2c2f7bdd921' 
  AND (
    token = 'wbFwunvMm59swil5xaXUO46bncTlijmDlbg2ukFty/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027