UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kp10jImDx77awdNoKUJgGnsJlpf3k/v7IFa7HC/6mhs=' 
WHERE 
  key_id = '6d25b0dff9180fae99e3be59ff7c73ab66b393d36f26883bd0c42011b605b731' 
  AND (
    token = 'Kp10jImDx77awdNoKUJgGnsJlpf3k/v7IFa7HC/6mhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027